package ctn.convert;

import ctn.hibernate.po.CtnCpaInfo;
import ctn.service.dto.PlugDTO;



public class CPAInfoCovert {
	//private static DateFormat   df=new   SimpleDateFormat( "yyyy-MM-dd   hh:mm:ss "); 
	
	public static PlugDTO convertPo2DTO(CtnCpaInfo po,PlugDTO dto){
		if(dto==null){
			dto=new PlugDTO();
		}
		dto.setID(po.getId());
		dto.setCpaName(po.getName());
		dto.setCreateDate(po.getCreateDate());
		dto.setCreateUserName(po.getCreateUser());
		dto.setInfoDesc(po.getInfoDesc());
		return dto;
	}
	public static CtnCpaInfo convertDTO2Po(PlugDTO dto,CtnCpaInfo po){
		if(po==null){
			po=new CtnCpaInfo();
		}
		po.setId(dto.getID());
		po.setName(dto.getCpaName());
		po.setCreateDate(dto.getCreateDate());
		po.setCreateUser(dto.getCreateUserName());
		po.setInfoDesc(dto.getInfoDesc());
		return po;
	}
}
